<template>
    <div>
        <text class="h2">{{question.index}}. {{question.title}}:</text><input  v-model="answer" ref="input" class="input" type="text" />
        <list class="list">
            <cell>
               <div v-bind:class=" [item.key == answer?'cell-select':'cell']" key="item.key" v-for="item in question.chooseItems" @click="selectItem(item.key)">
                   <text v-bind:class="[item.key == answer?'order-select':'order'] ">{{item.key}}</text>
                   <text class="option">{{item.value}}</text>
               </div>
            </cell>
        </list>
    </div>
</template>
<style scoped>


    .order-select{
        width: 90px;
        height: 88px;
        padding-top: 20px;
        color: #ffffff;
        background-color: #42b7ff;
        border-radius: 6px 0 0 6px;
        text-align: center;
    }
    .cell{
        height: 88px;
        border-style: solid;
        border-width: 1px;
        border-color: #f0f0f0;
        border-radius: 6px;
        flex-direction: row;
        margin-bottom: 20px;
    }

    .cell-select{
        height: 88px;
        border-style: solid;
        border-width: 1px;
        border-radius: 6px;
        flex-direction: row;
        margin-bottom: 20px;
        border-color: #42b7ff;
    }
    .order{
       width: 90px;
        height: 88px;
        padding-top: 20px;
        text-align: center;
        font-size: 32px;
        color: #42b7ff;
    }


    .option{
        font-size: 32px;
        padding-top: 24px;
        padding-left: 32px;
        flex:1;
        height: 88px;

    }
    .h2{
        font-size: 28px;
        color: #2e2e2e;
        margin-top: 40px;
        margin-bottom: 28px;
    }
    .input{
        width: 300px;
        border:none;
        font-size: 40px;
        margin-bottom: 26px;
        margin-left: 30px;
    }
</style>
<script>
    export default{
        props:{
            question:Object
        },
        methods:{
            "selectItem":function(key){
                this.answer = key;
            }
        },
        data(){
            return{
                answer:''
            }
        }
    }
</script>
